<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page
	import="com.sun.org.apache.bcel.internal.generic.INSTANCEOF,com.moment.model.InstrumentBankData"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN"
	dir="ltr">
<head>
<title>Moment Mobile Payments</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/styles/layout.css" type="text/css" />
<script src="//code.jquery.com/jquery-1.9.1.js"></script>



</head>
<body id="top">
	<%@include file="loggedinheader.jsp"%>
	<%@ page import="org.json.*"%>
	<%@ page import="com.moment.model.*"%>

	<%@ page language="java" contentType="text/html; charset=UTF-8"
		pageEncoding="UTF-8"%>
	<%@page import="java.util.*"%>
	<%!String s[];%>
	<%!String saving, current;%>
	You are not logged in
	<br />
	<a href="index.jsp">Please Login</a>
	<jsp:useBean id="userObj" class="com.moment.model.UserReg"
		scope="session" />
	<div class="wrapper col3">

		<div id="intro">
			<div id="logout">
				<a href="/MMP/LogoutController"><img
					src="<%=request.getContextPath()%>/images/logout.png" alt="Logout" /></a>
			</div>
			<div class="fl_left1">

				<div id="login1">
					<div class="imgl">
						<img alt="Embedded Image" height="128" width="128"
							src="data:image/jpeg;base64,<jsp:getProperty name="userObj" property="imagestr" />" />
					</div>
				</div>
				<div id="instrumentsmain">
					<div>

						<h2>
							<center><span id="viewedit">View</span> Location</center>
						</h2>
					</div>

					<jsp:useBean id="locationObj" class="com.moment.model.LocationData"
						scope="session" />


					<form action="../LocationController" method="post">

						<table>

							<tr>
								<td>Name:</td>
								<td><input class="formelement" type="text" name="lname" id="lname"
									value="<%=locationObj.getLocationname()%>" /><label class="viewform"><%=locationObj.getLocationname()%></label></td>
							</tr>
							<tr>
								<td>Address:</td>
<td><textarea class="formelement" rows="5" cols="50" name="laddress" id="laddress"><%=locationObj.getLocationadd()%></textarea><label class="viewform"><%=locationObj.getLocationadd()%></label></td>
							</tr>
<tr><td>Instrument</td><td><select class="formelement" id="linstru" name="linstru">
           <% 
           s=(String[])session.getAttribute("instrumentlist");
           System.out.println("iname"+request.getParameter("iname"));

           System.out.println("s="+s);
           for(String ss:s){
        	   String select = "";
        	   if(ss.equalsIgnoreCase(locationObj.getInstrumentname()))
        	   {
        		   select = "selected='selected'";   
        	   }
           %>
           <option value="<%=ss%>" <%=select%>><%=ss%></option>
           <%
           }
           %>
           </select><label class="viewform"><%=locationObj.getInstrumentname()%></label></td></tr>


						</table>




						<div class="fl_right">
							<input type="submit" class="myButton formelement" value="Update" />
							<input type="hidden" name="ltype" value="update" />
							<input type="hidden" name="lid" value="<%=locationObj.getLocationid()%>" />
							<input type="button" class="myButton viewform" id="editform" onclick="showform();" class="myButton" value="Edit" />
						</div>
					</form>




				</div>

			</div>
		</div>
	</div>
	<br class="clear" />


	<%@include file="footer.jsp"%>

	<script>
		$("document").ready(function() {
			$(".formelement").hide();
		});
		function showform()
		{
			$(".viewform").hide();
			$(".formelement").show();
			$("#viewedit").html("Edit");
			return false;
			
		}
		</script>
</body>
</html>

